inherit eutils linux-mod


MY_PN="ASUS_ACPI"

DESCRIPTION="Asus ACPI driver (with Eeepc support)"
HOMEPAGE="http://support.asus.de"
LICENSE="GPL2"
KEYWORDS="~x86"
#RESTRICT="fetch"
SRC_URI=" http://dlsvr02.asus.com/pub/ASUS/EeePC//${MY_PN}_${PV}.rar"

RDEPEND="app-arch/unrar"

S="${WORKDIR}/asus_acpi"
KERNEL_DIR="/usr/src/linux/"
MODULE_NAMES="asus_acpi(acpi:${S}:${S})"
BUILD_TARGETS="clean all"

src_unpack() {
	unrar x "${DISTDIR}/${MY_PN}_${PV}.rar"
	tar zxvf "${WORKDIR}/asus_acpi.tar.gz"
	mv "${S}/Makefile" "${S}/Makefile.orig"
	cp "${FILESDIR}/Makefile" "${S}/Makefile"
	chmod +x "${S}/Makefile"

	# Patch to handle function rename
	mv "${S}/asus_acpi.c" "${S}/asus_acpi.c.orig"
	sed s/acpi_bus_generate_event/acpi_bus_generate_proc_event/ \
		${S}/asus_acpi.c.orig >"${S}/asus_acpi.c"
}
